package com.byxy.action;

import java.io.File;
import java.io.FileInputStream;

import javax.annotation.Resource;

import com.byxy.service.OrderService;
import com.opensymphony.xwork2.ActionSupport;

public class UploadAction extends ActionSupport {
	/**
	 * 
	 */
	private static final long serialVersionUID = -7718336976815255707L;
	private File execl;
	private String execlFileName;
	private String execlContentType;

	public File getExecl() {
		return execl;
	}

	public String getExeclFileName() {
		return execlFileName;
	}

	public String getExeclContentType() {
		return execlContentType;
	}

	public void setExecl(File execl) {
		this.execl = execl;
	}

	public void setExeclFileName(String execlFileName) {
		this.execlFileName = execlFileName;
	}

	public void setExeclContentType(String execlContentType) {
		this.execlContentType = execlContentType;
	}

	@Resource
	private OrderService orderService;

	@Override
	public String execute() throws Exception {
		// FileUtils.copyFile(photo, new
		// File("C:/Users/guofuhan/Desktop/"+photoFileName));
		orderService.addEXCL(new FileInputStream(execl));
		return SUCCESS;
	}

}
